package com.cloudfun.campusshare.common.model.vo;

import com.cloudfun.campusshare.annotation.ImageSetUrl;
import com.cloudfun.campusshare.common.constant.BankCardCategory;
import com.cloudfun.campusshare.common.constant.BaseConstant;
import com.cloudfun.campusshare.common.constant.MerchantType;
import com.cloudfun.campusshare.common.constant.StoreType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.*;
import java.util.List;

/**
 * @Author : linyangping
 * @Date : Created in 4:20 PM 2019/11/20
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "企业认证")
public class AuthOrgVO {

//    @ApiModelProperty(value = "当前表单")
//    private Integer pageNo=0;

    @ApiModelProperty(value = "法人姓名")
//    @NotEmpty
    @Length(min = 1, max = 5, message = "法人姓名限制1-5个字")
    @Pattern(regexp = BaseConstant.CHINESE, message = "法人姓名错误")
    private String name;

    @ApiModelProperty(value = "法人身份证号码")
//    @NotEmpty
    @Length(min = 18, max = 18, message = "身份证号码限制18个字")
    @Pattern(regexp = BaseConstant.ALPHABET_DIGITAL, message = "身份证号码错误")
    private String idNum;

    @ApiModelProperty(value = "企业名称")
//    @NotEmpty
    private String orgName;

    @ApiModelProperty(value = "企业地址")
    private String orgAddr;

//    @NotEmpty
    @ApiModelProperty(value = "详细地址")
    @Length(max = 50, message = "详细地址限制50个字符")
    @Pattern(regexp = BaseConstant.ALPHABET_DIGITAL_CHINESE, message = "详细地址错误")
    private String detailAddr;

//    @NotEmpty
    @ApiModelProperty(value = "统一社会信用代码")
    @Length(min = 18, max = 18, message = "统一社会信用代码限制18个字符")
    @Pattern(regexp = BaseConstant.ALPHABET_DIGITAL, message = "统一社会信用代码错误")
    private String socialCode;

//    @NotEmpty
    @ApiModelProperty(value = "银行账户")
//    @Length(min = 19, max = 19, message = "银行账号限制19个字符")
//    @Pattern(regexp = BaseConstant.ALPHABET_DIGITAL, message = "银行账号错误")
    private String bankAccount;

//    @NotEmpty
    @ApiModelProperty(value = "银行账号名称")
    @Length(min = 1, max = 25, message = "银行账户1-25个字符")
//    @Pattern(regexp = BaseConstant.CHINESE, message = "银行账号名称错误")
    private String bankAccountName;

    @ApiModelProperty(value = "开户银行")
//    @NotBlank(message = "开户银行不能为空")
    private String depositBank;

    @ApiModelProperty(value = "开户银行所在省")
//    @NotBlank(message = "开户银行所在省不能为空")
    private String bankProvince;

    @ApiModelProperty(value = "开户银行所在市")
//    @NotBlank(message = "开户银行所在市不能为空")
    private String bankCity;

    @ApiModelProperty(value = "开户银行支行")
//    @NotBlank(message = "开户银行支行不能为空")
    private String depositSubBank;

    @ApiModelProperty(value = "其他资料")
    @ImageSetUrl(methodName = "setOtherInformation",message = "文件地址错误")
    private ImageVo otherInformation;

    @ApiModelProperty(value = "邮箱")
//    @NotBlank
    private String email;

    @ApiModelProperty(value = "手机号")
//    @NotBlank
    private String phone;

    @ApiModelProperty(value = "商户类型")
//    @NotNull
    private MerchantType merchantType = MerchantType.COMPANY;

    @ApiModelProperty(value = "门店类型")
//    @NotNull
    private StoreType storeType = StoreType.STORE;

    @ApiModelProperty(value = "门店名称")
//    @NotBlank
    private String storeName;

    @ApiModelProperty(value = "门店省")
//    @NotBlank
    private String storeProvince;

    @ApiModelProperty(value = "门店市")
//    @NotBlank
    private String storeCity;
    @ApiModelProperty(value = "门店区")
//    @NotBlank
    private String storeArea;
    @ApiModelProperty(value = "门店详细地址")
//    @NotBlank
    private String storeAddress;

    @ApiModelProperty(value = "银行卡户主")
//    @NotBlank
    private String bankName;

    @ApiModelProperty(value = "开户行支行号")
//    @NotBlank
    private String bankBranchNo;

    @ApiModelProperty(value = "开户行身份证号")
//    @NotBlank
    private String bankBranchIdcardNo;

    @ApiModelProperty(value = "开户行身份证号有效日期")
//    @NotBlank
    private String bankBranchIdcardEndTime;

    @ApiModelProperty(value = "法人身份证号有效日期")
//    @NotBlank
    private String idcardEndTime;

    @ApiModelProperty(value = "营业执照有效日期")
//    @NotBlank
    private String licenseEndTime;

    @ApiModelProperty(value = "银行类别")
//    @NotNull
    private BankCardCategory bankCardCategory;

    @ApiModelProperty(value = "手持银行卡照片")
//    @NotNull
    @ImageSetUrl(methodName = "setHoldingBankPhoto",message = "图片地址错误")
    private ImageVo holdingBankPhoto;
    @ApiModelProperty(value = "银行卡照片")
//    @NotNull
    @ImageSetUrl(methodName = "setBankCardPhoto",message = "图片地址错误")
    private ImageVo bankCardPhoto;
    @ApiModelProperty(value = "开户人手持身份证照片")
//    @NotNull
    @ImageSetUrl(methodName = "setBankHoldingIdCardPhoto",message = "图片地址错误")
    private ImageVo bankHoldingIdCardPhoto;
    @ApiModelProperty(value = "开户人身份证正面照片")
//    @NotNull
    @ImageSetUrl(methodName = "setBankCardFrontPhoto",message = "图片地址错误")
    private ImageVo bankCardFrontPhoto;
    @ApiModelProperty(value = "开户人身份证反面照片")
//    @NotNull
    @ImageSetUrl(methodName = "setBankCardBackPhoto",message = "图片地址错误")
    private ImageVo bankCardBackPhoto;
    @ApiModelProperty(value = "法人手持身份证照片")
//    @NotNull
    @ImageSetUrl(methodName = "setLegalHoldingCardPhoto",message = "图片地址错误")
    private ImageVo legalHoldingCardPhoto;
    @ApiModelProperty(value = "法人身份证正面照片")
//    @NotNull
    @ImageSetUrl(methodName = "setLegalPersonIdCardFrontPhoto",message = "图片地址错误")
    private ImageVo legalPersonIdCardFrontPhoto;
    @ApiModelProperty(value = "法人身份证反面照片")
//    @NotNull
    @ImageSetUrl(methodName = "setLegalPersonIdCardBackPhoto",message = "图片地址错误")
    private ImageVo legalPersonIdCardBackPhoto;
    @ApiModelProperty(value = "营业执照照片")
//    @NotNull
    @ImageSetUrl(methodName = "setBusinessLicensePhoto",message = "图片地址错误")
    private ImageVo businessLicensePhoto;
    @ApiModelProperty(value = "门头照照片")
//    @NotNull
    @ImageSetUrl(methodName = "setDoorPhoto",message = "图片地址错误")
    private ImageVo doorPhoto;
    @ApiModelProperty(value = "门店内景照")
    @Size(max = 3, message = "最多三张")
//    @NotNull
    @ImageSetUrl(methodName = "setStoreInteriorPhotos",message = "图片地址错误")
    private List<ImageVo> storeInteriorPhotos;
    @ApiModelProperty(value = "租赁合同证明文件照片")
    @Size(max = 3, message = "最多三张")
//    @NotNull
    @ImageSetUrl(methodName = "setPhotoOfLeaseContractDocument",message = "图片地址错误")
    private List<ImageVo> photoOfLeaseContractDocument;

    public MerchantType getMerchantType() {
        if (merchantType==null){
            return MerchantType.COMPANY;
        }
        return merchantType;
    }

    public StoreType getStoreType() {
        if (storeType==null){
            return StoreType.STORE;
        }
        return storeType;
    }
}
